package cn.nexd.app.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by wangxu on 16/2/29.
 */
public class ExpandableModel implements Parcelable {

    public static final Creator<ExpandableModel> CREATOR = new Creator<ExpandableModel>() {
        @Override
        public ExpandableModel createFromParcel(Parcel in) {
            return new ExpandableModel(in);
        }

        @Override
        public ExpandableModel[] newArray(int size) {
            return new ExpandableModel[size];
        }
    };
    private String cityName;
    private ArrayList<MallModel> mallModels;

    public ExpandableModel(String cityName, ArrayList<MallModel> mallModels) {
        this.cityName = cityName;
        this.mallModels = mallModels;
    }

    public ExpandableModel(Parcel in) {
        cityName = in.readString();
        mallModels = in.createTypedArrayList(MallModel.CREATOR);
    }

    public ExpandableModel() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(cityName);
        dest.writeTypedList(mallModels);
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public ArrayList<MallModel> getMallModels() {
        return mallModels;
    }

    public void setMallModels(ArrayList<MallModel> mallModels) {
        this.mallModels = mallModels;
    }
}
